# AUTHOR: DING
# -*- codeing = utf-8 -*-
# @Time: 2024/3/1 9:44
# @Author: 86139
# @Site: 
# @File: model.py
# @Software: PyCharm
# tensorboard --logdir=pytorch/logs --port=6007

# 搭建神经网络
import torch
from torch import nn


class MyModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.model1 = nn.Sequential(
            nn.Conv2d(3, 32, (5, 5), padding=2),
            nn.MaxPool2d(2),
            nn.Conv2d(32, 32, (5, 5), padding=2),
            nn.MaxPool2d(2),
            nn.Conv2d(32, 64, (5, 5), padding=2),
            nn.MaxPool2d(2),
            nn.Flatten(),
            nn.Linear(1024, 64),
            nn.Linear(64, 10))

    def forward(self, x):
        return self.model1(x)


if __name__ == "__main__":
    network = MyModule()
    input = torch.ones((64, 3, 32, 32))
    output = network(input)
    print(output.shape)